package com.ruoyi.web.controller.school;

import com.ruoyi.common.core.controller.BaseController;
import com.ruoyi.common.core.domain.AjaxResult;
import com.ruoyi.common.core.page.TableDataInfo;
import com.ruoyi.school.domain.Student;
import com.ruoyi.school.domain.dto.HonorWallTopThreeDTO;
import com.ruoyi.school.domain.vo.HonorWallTopThreeVo;
import com.ruoyi.school.service.PacHonorWallService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;
import java.util.List;

/*
 * @Author Lin
 * @Description 荣誉墙相关接口
 * @Date 2025/5/31
 */
@Api(tags = "荣誉墙相关接口")
@RestController
@RequestMapping("/school/honorWall")
public class PacHonorWallController extends BaseController {
    @Resource
    private PacHonorWallService pacHonorWallService;

    /**
     * 获取有证明材料的数据
     */
    @ApiOperation("获取有证明材料的数据")
    @GetMapping("/list2")
    public TableDataInfo list2(Student student) {
        List<HonorWallTopThreeVo> list2 = pacHonorWallService.list2(student);
        return getDataTable(list2);
    }

    /**
     * 查询荣誉墙前三
     */
    @GetMapping("/getTopThree")
    public AjaxResult getTopThree(HonorWallTopThreeDTO honorWallTopThreeDTO) {
        List<HonorWallTopThreeVo> list = pacHonorWallService.getTopThree(honorWallTopThreeDTO);
        return success(list);
    }

    /**
     * 查询荣誉墙前三
     */
    @GetMapping("/list")
    public TableDataInfo list(Student student) {
        List<Student> list = pacHonorWallService.list(student);
        return getDataTable(list);
    }

    /**
     * 获取某个学生的荣誉列表
     */
    @GetMapping("/stuHonorList")
    public AjaxResult stuHonorList(HonorWallTopThreeDTO honorWallTopThreeDTO) {
        startPage();
        List<HonorWallTopThreeVo> list = pacHonorWallService.stuHonorList(honorWallTopThreeDTO);
        return success(list);
    }

}
